//
//  GetTimestamp.h
//  CarsFiles_QYB
//
//  Created by 程虎 on 2017/4/5.
//  Copyright © 2017年 程虎. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface Tools : NSObject

+(Tools *)shareInstance;

#pragma mark - 用户名加密KEY
+ (NSString *)getEncryptKey;
#pragma mark - 用户密码加密KEY
+ (NSString *)getSigntKey;

#pragma mark - 获取当前时间戳
+ (NSString *)getCurrentDate;
+ (NSString *)stringFromDate:(NSDate *)date;
+ (NSDate *)getInternetDate;
#pragma mark - 字符串转数组
+ (NSArray *)toJSONData:(id)jsonData;

#pragma mark - 将字典或者数组转化为JSON串
+ (NSString *)toJSONString:(id)theData;

#pragma mark - leap图片数组转化
+ (NSMutableArray *)leapImgAry:(NSArray *)arrays;

#pragma mark - 判断首字符是不是汉字
+ (BOOL)isChineseFirst:(NSString *)firstStr;

#pragma mark 正则表达式
+ (BOOL)MatchLetter:(NSString *)str;

#pragma mark - 等比例缩放图片
+ (UIImage*)imageCompressWithSimple:(UIImage*)image scale:(float)scale;

#pragma mark - 正则验证用户名和密码
+ (BOOL)checkUserNameRationality:(NSString *)rationalityString;

#pragma mark - 正则验证手机号
+ (BOOL)checkPhoneNORationality:(NSString *)rationalityString;

#pragma mark - 正则验证密码
+ (BOOL)checkPassWordRationality:(NSString *)rationalityString;

#pragma mark - 替换手机号中间四颗星
+ (NSString *)replaceWithMobileNO:(NSString *)mobileStr;

#pragma mark - 绘制tabbar 导航栏边框线
+ (UIImage *) createImageWithColor: (UIColor*) color;

#pragma mark - 计算label的高度
+ (CGFloat )getlabsHeight:(NSString *) strings Font:(CGFloat ) font Width:(CGFloat )width;

#pragma mark - 计算label的宽度
+ (CGFloat )getlabsWidth:(NSString *) strings Font:(CGFloat ) font Height:(CGFloat )height;

#pragma mark - 拉伸图片
+ (UIImage *)drawingPicturesWithmargin:(CGFloat )margin images:(NSString *)imgName;

#pragma mark - 字符串分解成数组
+ (NSArray *)jsonStringIntoArray:(NSString *)aryStr;

#pragma mark - 设置label间距
- (NSMutableAttributedString *)setLabelLineSpaceTextString:(NSString *)textString;

#pragma mark - 创建lab
- (UILabel *)creat_Label:(NSString *)texts Color:(UIColor *)colors Font:(CGFloat )fontsize tag:(NSInteger)tags Alignment:(NSInteger )txtAlignment Lines:(NSInteger )lines;

#pragma mark - 创建button
- (UIButton *)creat_Button:(NSString *)titles Color:(UIColor *)colors BackColors:(UIColor *)backColors Font:(CGFloat )fontsize tag:(NSInteger)tags;
+ (UIButton *)creat_Buttons:(NSString *)titles Color:(UIColor *)colors BackColors:(UIColor *)backColors Font:(CGFloat )fontsize tag:(NSInteger)tags;

#pragma mark - 替代星号
+ (NSString *)replaceWithMobileNO:(NSString *)mobileStr number:(int )num numbei:(int  )nub change:(NSString *)change;

#pragma mark - 跳转到下一个控制器
+ (void)ToNextName:(NSString *)nameVC Params:(id)params CurrentVC:(UIViewController *)currentVC Completion:(void (^)(id obj)) completionblock;

#pragma mark - 判断手机号码格式是否正确
+ (BOOL)valiMobile:(NSString *)mobile;
#pragma mark - 判断身份证号码格式是否正确
+ (BOOL)valiPenson:(NSString *)Penson;

#pragma mark - 临时工具
#pragma mark - 解析头像
+ (NSString *)resolutionHeadImage:(NSString *)headimg;

#pragma mark - 第三方登录view
+ (UIView *)creatThirdPartyView;

#pragma mark - 字典通过plist文件存本地
+ (void)Dictionariesplistname:(NSMutableArray *)pname;
#pragma mark - 定期更新一下用户信息
+ (void)updatepreson;
#pragma mark - 创建view
+ (UIView *)creatColumView:(NSDictionary *)dict Tags:(NSInteger )tags;

+ (UIView *)creatUserView;
+ (UIView *)creatPhoneView;
@end
